package com.hardydou.common.result;

import java.io.Serializable;

/**
 * @author ：hardy
 * @description：json数据格式
 * @date ：Created in 2020-03-04
 * @Copyright ：Hardydou.com
 */
public class Result<T> implements Serializable {

    private Code code;
    private T data;

    public Result(Code code, T data) {
        this.code = code;
        this.data = data;
    }

    public boolean isRetry() {
        return code.isRetry();
    }

    public int getCode() {
        return code.getCode();
    }

    public String getMessage() {
        return code.getTip();
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
